home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-11-11 | 4.7 KB | 122 lines | [TEXT/MPS ] |
- /*------------------------------------------------------------------------------
- *
- * File: InstallSplitInTwoFile.r - Rez Source
- *
- * Author: Tim Fredenburg
- * Based on InstallATomeFile.r by Deric Horn.
- *
- * The template is used for installing a file that has been split into
- * two pieces by FileAndRsrcSplitterTool.
- *
- * This templates works ONLY with files that:
- * • are split into exactly two pieces
- * • only have a resource fork, no data fork
- * • have each split piece compressed into separate InstaCompOne archives
- *
- * To prepare files that will be used by this template your build script
- * needs to include something like:
- * FileAndRsrcSplitterTool "Agnes" -s 810000
- * SetFile -t 'ttvf' -c 'gala' "Agnes.rsrc1"
- * SetFile -t 'ttvf' -c 'gala' "Agnes.rsrc2"
- * Echo "Include ∂"Agnes∂" 'vers' (1);" ∂
- * | Rez -a -o "Agnes.rsrc1"
- * Echo "Include ∂"Agnes∂" 'vers' (1);" ∂
- * | Rez -a -o "Agnes.rsrc2"
- * InstaCompOneTool -e -f "Agnes" "Agnes.rsrc1" -o "Tome4"
- * InstaCompOneTool -e -f "Agnes" "Agnes.rsrc2" -o "Tome3"
- *
- * We need to set the file type and creator of the split pieces back to the
- * the original file's type and creator to get around a problem when
- * running ScriptCheck. When ScriptCheck tries to get the version of the
- * file to fill in in the 'infa' it (or the atom extender) thinks it can't find
- * the file because the type and creator or wrong. Oddly, there is no problem
- * getting the file's size though. Also, we have to copy the 'vers' 1 resource
- * to the split pieces so that there is a version for ScriptCheck to find.
- * Note the flags to InstaCompOneTool (-f) renaming the split pieces back to
- * the name of the original file and also (-e) specifying that the data fork
- * really belongs in the resource fork.
- *
- *----------------------------------------------------------------------------*/
-
- #ifndef COMPAREPROC
- #define COMPAREPROC useVersProcToCompare
- #endif
- #ifndef DELETEFILE
- #define DELETEFILE deleteWhenRemoving
- #endif
-
- #ifndef TARGETTFID
- #define TARGETTFID targetFileBase+ID
-
- resource 'intf' (TARGETTFID)
- {
- format1
- {
- noSearchForFile, /* Search by calling the referenced 'insp' resource */
- TypeCrNeedNotMatch, /* Type and creator must match */
- FILETYPE, /* Target File Type */
- FILECREATOR, /* Target File Creator */
- 0, /* Target File Finder Flags */
- kScriptCheckSetsDate, /* Target File Creation Date of new file */
- kScriptCheckSetsDate, /* Target File Mod. Date of new file */
- 0, /* Search Proc. Rsrc ID */
- DESTDIR FILENAME /* Destination Path */
- }
- };
- #endif
-
- #ifndef HCDeCompResources
- #define HCDeCompResources
- #define HCDeCompInexID 241 /* Mister Majic Number */
- include "InstaCompOneAtomExt.rsrc" 'exfn' (HCDeCompInexID); /* Majic Decompressulator */
- include "InstaCompOneAtomExt.rsrc" 'inex' (HCDeCompInexID);
- #endif
-
- resource 'infa' (sourceFileBase+ID,FILENAME)
- {
- format1
- {
- DELETEFILE, /* Remove file or rsrc if remove clicked */
- deleteWhenInstalling, /* Delete target before copy */
- copy, /* Copy file or rsrc to destination */
- dontIgnoreLockedFile, /* Set the Target file to be locked or not. */
- dontSetFileLocked, /* Set the Target file to be locked or not. */
- COMPAREPROC, /* How we determine if the target is newer. */
- srcNeedExist, /* Ignore atom if file does not exist */
- rsrcForkInDataFork, /* Determines where to read the rsrc fork from */
- leaveAloneIfNewer, /* OK for a newer version of this file to exist */
- updateExisting, /* Keep tgt file if it already exists */
- copyIfNewOrUpdate, /* Only update if target exists */
- rsrcFork, /* Apply operation to rsrc fork */
- dataFork, /* Apply operation to data fork */
- 0, /* total size uncomp */ /*SCRIPTCHECK SETS*/
- 0, /* Finder Attribute Flags */ /*SCRIPTCHECK SETS*/
- TARGETTFID, /* Tgt file spec ID */
- {
- PART1TOMEID, /* Source File Spec */ /* parts list, with exact target part sizes. */
- 0, /* Target Data Fork Part Size Uncompressed *//*SCRIPTCHECK SETS*/
- 0, /* Target Rsrc Fork Part Size Uncompressed *//*SCRIPTCHECK SETS*/
-
- PART2TOMEID, /* Source File Spec */ /* parts list, with exact target part sizes. */
- 0, /* Target Data Fork Part Size Uncompressed *//*SCRIPTCHECK SETS*/
- 0 /* Target Rsrc Fork Part Size Uncompressed *//*SCRIPTCHECK SETS*/
- },
- 0x0, /* Source Version Number in BCD format. *//*SCRIPTCHECK SETS*/
- 0, /* Version Compare rsrc ID (zero if none) */
- HCDeCompInexID, /* Atom Extender ID */
- FILENAME /* Atom Description */
- }
- };
-
-
- #undef DELETEFILE
- #undef COMPAREPROC
- #undef TARGETTFID
- #undef ID
- #undef PART1TOMEID
- #undef PART2TOMEID
- #undef FILETYPE
- #undef FILECREATOR
- #undef DESTDIR
- #undef FILENAME
-